package com.nulldev.util.web.YouTubeExtractor.advertising;

import com.nulldev.util.VariableAPI.MathUtil;
import com.nulldev.util.data.Variables;
import com.nulldev.util.languages.json.uniapi.UniJsonValue;

public class YTEAdPlacement {

	public static enum YTEAdPlacementType {
		/** Placed to the right or below the player. */
		UI_PLACED_AD,
		/** A dismissable ad shown over the video player. */
		VIDEO_OVERLAY_AD,
		/** Shown during the video. */
		MIDROLL_AD,
		/** Shown before or after viewing a video. */
		PREROLL_OR_POSTROLL_BATCH
	}

	private final String kind;
	private final YTEAdPlacementType type;
	private final UniJsonValue placementObject;

	public YTEAdPlacement(final String kind, final YTEAdPlacementType type, final UniJsonValue placementObject) {
		this.kind = Variables.requireNonNullObject(kind, "kind");
		this.type = Variables.requireNonNullObject(type, "type");
		this.placementObject = Variables.requireNonNullObject(placementObject, "placementObject");
	}

	public String getKind() {
		return this.kind;
	}

	public YTEAdPlacementType getType() {
		return this.type;
	}

	public UniJsonValue getObject() {
		return this.placementObject;
	}

	@Override
	public String toString() {
		return "YTEAdPlacement[hash=" + MathUtil.toHex(super.hashCode()) + ",type=" + this.type + "]";
	}
}
